/*
 * GameRegister.java
 * Copyright(C) trythis.cn
 * 2022年12月17日 19时46分25秒Created
 */
package com.njcb.game.repository.dao;

import com.njcb.ams.repository.dao.base.BaseMyBatisDAO;
import com.njcb.ams.repository.dao.mapper.BaseMapper;
import com.njcb.game.repository.dao.mapper.GameRegisterMapper;
import com.njcb.game.repository.entity.GameRegister;
import com.njcb.game.repository.entity.GameRegisterExample;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Repository;

@Repository
public class GameRegisterDAO extends BaseMyBatisDAO<GameRegister, GameRegisterExample, Integer> {
    @Autowired
    private GameRegisterMapper mapper;

    public GameRegisterDAO() {
        this.entityClass = GameRegister.class;
    }

    @Override
    @SuppressWarnings("unchecked")
    public GameRegisterMapper getMapper() {
        return mapper;
    }

    public GameRegister selectByNo(String runnersNo) {
        GameRegisterExample example = new GameRegisterExample();
        example.createCriteria().andRunnersNoEqualTo(runnersNo);
        return selectOneByExample(example);
    }

    public GameRegister selectByToken(String token) {
        GameRegisterExample example = new GameRegisterExample();
        example.createCriteria().andTokenEqualTo(token);
        return selectOneByExample(example);
    }
}